import { defineStore } from "pinia";
import type { StoreDefinition } from "pinia";

type SystemStoreState = {
    address: string;
};

export const useStoreUserAddress: StoreDefinition<string, SystemStoreState> =
    defineStore<string, SystemStoreState>("userAddress", {
        state: (): SystemStoreState => ({
            address: ""
        }),

        actions: {
            /**
             * @description 更新语言
             * */
            updateUserAddress(value: string) {
                this.address = value;
            }
        },

        getters: {
            getUserAddress(state) {
                return state.address;
            }
        }
    });
